package edu.pku.hawk.controller.detectmonitor;

import java.io.File;
import java.io.FileInputStream;

import edu.pku.hawk.controller.util.Constants;
import edu.pku.hawk.controller.util.MOutputStreamQueue;
import edu.pku.hawk.controller.util.MQManager;

public class TestFileSender {

	public static void main(String[] args) {

		try {
			MQManager manager = new MQManager(Constants.MQServer_Name, Constants.MQServer_Password,
					Constants.MQServer_URL);
			
			MOutputStreamQueue q = manager.getOutputStreamQueue("FileSend");
			

			File f = new File("files/111.jpg");
			System.out.println(f.exists());
			FileInputStream fis = null;
			try {
				fis = new FileInputStream(f);
				q.send(fis);

			} catch (Exception ex) {
				ex.printStackTrace();
			}
			
		} catch (Exception ex) {
			ex.printStackTrace();
		}

	}
}
